//
//  TQROSTViewController.m
//  ROSE
//
//  Created by 艾阳 on 2018/6/1.
//  Copyright © 2018年 HeNanZhongDunYunAn. All rights reserved.
//

#import "TQROSTViewController.h"
#import "ThreeInputView.h"

@interface TQROSTViewController ()
@property (nonatomic,strong) UIScrollView *scrollView;
@property (nonatomic,strong) ThreeInputView *inputView;
@property (nonatomic,strong) UILabel *hintLabel;
@property (nonatomic,strong) UILabel *balanceLabel;
@end

@implementation TQROSTViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"ROST提取";
    self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, size_width, size_height)];
    [self.view addSubview:self.scrollView];
    [self setUI];
    [self setSureBtn];
}

- (void)setUI{
   
    self.hintLabel = [[UILabel alloc]init];
    self.hintLabel.text = @"ROST";
    self.hintLabel.font = [UIFont systemFontOfSize:15];
    [self.view addSubview:self.hintLabel];
    
    self.balanceLabel = [[UILabel alloc]init];
    self.balanceLabel.textColor = [UIColor colorWithRed:183/255.0 green:18/255.0 blue:84/255.0 alpha:1];
    self.balanceLabel.text = @"1000";
    self.balanceLabel.font = [UIFont boldSystemFontOfSize:20];
    [self.view addSubview:self.balanceLabel];
    
    self.inputView = [[ThreeInputView alloc]init];
    [self.inputView setTitle:@[@"提取",@"提取地址",@"验证码"] PlaceHolder:@[@"输入提取数量",@"提取地址",@"验证码"]];
    [self.inputView setCountDownInTextfield:self.inputView.textField3];
    [self.inputView setScanButtonInTextfield:self.inputView.textField2];
    [self.view addSubview:self.inputView];
    
    [self makeLayout];
}

- (void)setSureBtn{
    UIButton *sureBtn = [[UIButton alloc]init];
    sureBtn.backgroundColor = [UIColor themeColor];
    sureBtn.titleLabel.textColor = [UIColor whiteColor];
    [sureBtn setTitle:@"确认提取" forState:UIControlStateNormal];
    [sureBtn.titleLabel setFont:[UIFont systemFontOfSize:15]];
    sureBtn.layer.masksToBounds = YES;
    sureBtn.layer.cornerRadius = 20.0f;
    [self.view addSubview:sureBtn];
    
    [sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(35);
        make.right.mas_equalTo(-35);
        make.bottom.mas_equalTo(-20);
        make.height.mas_equalTo(40);
    }];
}

- (void)makeLayout{
    [self.hintLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.top.mas_equalTo(30);
        make.height.mas_equalTo(15);
    }];
    
    [self.balanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.top.mas_equalTo(self.hintLabel.mas_bottom).with.offset(8);
        make.height.mas_equalTo(20);
    }];
    
    [self.inputView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.mas_equalTo(self.balanceLabel.mas_bottom).with.offset(30);
        make.height.mas_equalTo(300);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
